<?php

namespace WeForge;

use WeForge\Console\Commands\WeForgeWorkCommand;

trait RegistersCommands
{
    /**
     * Register weforge commands.
     *
     * @return void
     */
    protected function registerCommands()
    {
        if (! $this->app->runningInConsole()) {
            return;
        }

        $this->app->singleton(WeForgeWorkCommand::class, function ($app) {
            return new WeForgeWorkCommand($app['queue.weforgeWorker']);
        });

        $this->commands([WeForgeWorkCommand::class]);
    }
}
